//package com.jsyl.qies.web.controller.business;
//
//import com.jsyl.qies.business.domain.Question;
//import com.jsyl.qies.business.domain.StudentTrainingItems;
//import com.jsyl.qies.business.dto.ChildScheduleDTO;
//import com.jsyl.qies.business.dto.ConsolidateDTO;
//import com.jsyl.qies.business.dto.TeacherScheduleDTO;
//import com.jsyl.qies.business.service.IChildScheduleService;
//import com.jsyl.qies.business.service.IChildService;
//import com.jsyl.qies.business.vo.ChildScheduleVO;
//import com.jsyl.qies.business.vo.ChildVO;
//import com.jsyl.qies.common.core.controller.BaseController;
//import com.jsyl.qies.common.core.domain.AjaxResult;
//import com.jsyl.qies.common.core.page.TableDataInfo;
//import com.jsyl.qies.common.utils.DateUtils;
//import com.jsyl.qies.framework.util.ShiroUtils;
//import org.apache.shiro.authz.annotation.RequiresPermissions;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.ui.ModelMap;
//import org.springframework.web.bind.annotation.*;
//
//import java.util.List;
//
//@Controller
//@RequestMapping("/business/schedule")
//public class ChildScheduleController extends BaseController {
//
//    private String prefix = "business/schedule";
//
//    @Autowired
//    private IChildScheduleService childScheduleService;
//
//    @Autowired
//    private IChildService childService;
//
//    @RequiresPermissions("business:schedule:view")
//    @GetMapping()
//    public String schedule(ModelMap mmap) {
//        return prefix + "/schedule";
//    }
//
//    /**
//     * 查询课程列表
//     * @param childScheduleDTO
//     * @return
//     */
//    @PostMapping("/list")
//    @RequiresPermissions("business:schedule:list")
//    @ResponseBody
//    public TableDataInfo list(ChildScheduleDTO childScheduleDTO) {
//        startPage();
//        childScheduleDTO.setTeacherId(ShiroUtils.getUserId());
//        List<ChildScheduleVO> list = childScheduleService.selectChildScheduleList(childScheduleDTO);
//        return getDataTable(list);
//    }
//
//    /**
//     * 修改课程
//     * @param id
//     * @param mmap
//     * @return
//     */
//    @GetMapping("/edit/{id}")
//    public String edit(@PathVariable("id") Long id, ModelMap mmap) {
//        List<StudentTrainingItems> list = childScheduleService.selectByChildScheduleId(id);
//        ChildVO vo = childService.selectByChildScheduleId(id);
//        mmap.put("child", vo);
//        mmap.put("studentTrainingItems", list);
//        return prefix + "/edit";
//    }
//
//    /**
//     * 查询教研设置标准
//     * @param studentTrainingItemsId
//     * @param map
//     * @return
//     */
//    @GetMapping("/editTraining/{studentTrainingItemsId}")
//    public String editTraining(@PathVariable("studentTrainingItemsId") Long studentTrainingItemsId, ModelMap map) {
//        StudentTrainingItems studentTrainingItems = childScheduleService.selectByStudentTrainingItemsId(studentTrainingItemsId);
//        map.put("studentTrainingItems", studentTrainingItems);
//        return prefix + "/editTraining";
//    }
//
//    /**
//     * 修改老师设置标准
//     * @param teacherScheduleDTO
//     * @return
//     */
//    @PostMapping("/editSchedule")
//    public AjaxResult editSchedule(TeacherScheduleDTO teacherScheduleDTO) {
//        return toAjax(childScheduleService.editSchedule(teacherScheduleDTO));
//    }
//
//    @GetMapping("/switchover/{}")
//    public AjaxResult switchover() {
//
//        return null;
//    }
//
//    /**
//     * 添加巩固项目
//     * @param childId
//     * @param map
//     * @return
//     */
//    @PostMapping("/addConsolidate/{childId}")
//    public String addConsolidate(@PathVariable("childId")Long childId, ModelMap map) {
//        String lastMonth = DateUtils.getLastMonth();
//        List<Question> list = childScheduleService.addConsolidate(childId, lastMonth);
//        map.put("list", list);
//        return prefix + "addConsolidate";
//    }
//
//    /**
//     * 保存巩固题目
//     * @param consolidateDTO
//     * @return
//     */
//    @PostMapping("/addConsolidate")
//    public AjaxResult addConsolidate(ConsolidateDTO consolidateDTO) {
//        return toAjax(childScheduleService.addConsolidateList(consolidateDTO));
//    }
//
//}
